package com.itheima.dubbo.service;


import com.itheima.dubbo.UserInterface;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.rpc.RpcContext;

@DubboService //将dubbo注册到注册中心
public class UserServiceImpl implements UserInterface {

    @Override
    public String hello(String username) {
        String jwt = RpcContext.getContext().getAttachment("jwt");
        System.out.println(jwt);
        return "hello Dubbo username: " + username;
    }
}
